|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jade.onto.DefaultOntology
A simple implementation of the Ontology interface. Instances of
this class keeps all the ontology data in memory, and don't support an
external archive format.
| Fields inherited from interface jade.onto.Ontology |
ANY_SLOT,
ANY_TYPE,
BINARY_TYPE,
BOOLEAN_TYPE,
BYTE_TYPE,
CHARACTER_TYPE,
DATE_TYPE,
DOUBLE_TYPE,
FLOAT_TYPE,
FRAME_SLOT,
INTEGER_TYPE,
LONG_TYPE,
M,
NAME_OF_SEQUENCE_FRAME,
NAME_OF_SET_FRAME,
O,
PRIMITIVE_SLOT,
SEQUENCE_SLOT,
SET_SLOT,
SHORT_TYPE,
STRING_TYPE |
| Constructor Summary | |
DefaultOntology()
Default constructor. |
|
| Method Summary | |
void |
addRole(java.lang.String roleName,
SlotDescriptor[] slots)
Adds a new role to this ontology, without a user defined Java class to represent it. |
void |
addRole(java.lang.String roleName,
SlotDescriptor[] slots,
java.lang.Class newClass)
Adds a new role to this ontology, with a user defined Java class to represent it. |
void |
check(Frame f)
Checks whether a given frame is correct with respect to this ontology. |
void |
check(java.lang.Object o,
java.lang.String roleName)
Checks whether a given Java object is correct with respect to the given role in this ontology. |
java.lang.Object |
create(Frame f)
Creates an object, starting from a given frame. |
Frame |
createFrame(java.lang.Object o,
java.lang.String roleName)
Creates a frame from a given Java Object representing an instance of a given role. |
List |
createObject(List v)
Creates a List of Java objects from the given list of frame. |
void |
fromMetaOntologyRepresentation(AnOntology o)
Initialize this ontology based on the passed meta-ontology |
java.lang.String |
fromSL0String(java.lang.String str)
This method initialized this ontology object on the basis of its representation as an SL-0 expression. |
java.lang.Class |
getClassForRole(java.lang.String roleName)
Provides the Java class associated with this ontological role. |
java.lang.String |
getRoleName(java.lang.Class c)
|
SlotDescriptor[] |
getSlots(java.lang.String roleName)
Get the descriptions for all the slots that define the structure of a given ontological role. |
List |
getVocabulary()
|
boolean |
isRole(java.lang.String roleName)
Checks whether a given string is the name of a role in this ontology. |
void |
joinOntology(Ontology o)
Adds to this ontology all roles included into another ontology |
AnOntology |
toMetaOntologyRepresentation(java.lang.String ontologyName)
Return an object representing this ontology in terms of the JADE-Meta-Ontology and that is suitable to be encoded as a String and, for instance, become the content of an ACLMessage. |
java.lang.String |
toSL0String(java.lang.String ontologyName)
Writes the ontology represented by this Ontology object as an SL-0 expression. |
java.lang.String |
toString()
Return a String representing this ontology Object by calling the method toSL0String() and catching any exception. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public DefaultOntology()
| Method Detail |
public void addRole(java.lang.String roleName,
SlotDescriptor[] slots)
throws OntologyException
Ontology.addRole(String roleName, SlotDescriptor[] slots)
public void addRole(java.lang.String roleName,
SlotDescriptor[] slots,
java.lang.Class newClass)
throws OntologyException
Ontology.addRole(String roleName, SlotDescriptor[] slots, Class c)
public void joinOntology(Ontology o)
throws OntologyException
o - The Ontology object whose roles will
be addedOntology.joinOntology(Ontology o)
public List createObject(List v)
throws OntologyException
Ontology.createObject(List v)
public Frame createFrame(java.lang.Object o,
java.lang.String roleName)
throws OntologyException
Ontology.createFrame(Object o, String roleName)
public void check(Frame f)
throws OntologyException
Ontology.check(Frame f)
public void check(java.lang.Object o,
java.lang.String roleName)
throws OntologyException
Ontology.check(Object o, String roleName)
public boolean isRole(java.lang.String roleName)
throws OntologyException
Ontology.isRole(String roleName)
public SlotDescriptor[] getSlots(java.lang.String roleName)
throws OntologyException
Ontology.getSlots(String roleName)
public java.lang.String getRoleName(java.lang.Class c)
throws OntologyException
Ontology.getRoleName(Class c)public List getVocabulary()
List including the names of all the roles
in the ontology, i.e. the Vocabulary used by the ontologyOntology.getVocabulary()public java.lang.Class getClassForRole(java.lang.String roleName)
create() method to instantiate
objects. A useful technique is returning an interface or an abstract class,
while using concrete subclasses to create objects.a - string representing the name of the ontological roleDFAgentDescription.class
public java.lang.String fromSL0String(java.lang.String str)
throws Codec.CodecException,
OntologyException
jade.onto.JADEMetaOntologyOntology.fromSL0String(String)
public void fromMetaOntologyRepresentation(AnOntology o)
throws OntologyException
Ontology.fromMetaOntologyRepresentation(AnOntology)public java.lang.String toString()
toSL0String() and catching any exception.
Notice that this method ignores the name of the ontology and, therefore,
the method toSL0String() should be preferred, instead.public AnOntology toMetaOntologyRepresentation(java.lang.String ontologyName)
Ontology.toMetaOntologyRepresentation(String)
public java.lang.String toSL0String(java.lang.String ontologyName)
throws OntologyException
Ontology.toSL0String(String)
public java.lang.Object create(Frame f)
throws OntologyException
f - A frame containing initialization data for the object.getClassForRole(), or one of its subclasses).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||